//
//  MainViewController.swift
//  DouYuZB
//
//  Created by James on 2017/10/9.
//  Copyright © 2017年 James. All rights reserved.
//

import UIKit

class MainViewController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        
        addChildVC(name: "Home")
        addChildVC(name: "Live")
        addChildVC(name: "Follow")
        addChildVC(name: "Profile")
    }
    
    private func addChildVC(name : String) {
        //1.通过storyBoard 获取控制器
        let childVC = UIStoryboard(name: name, bundle: nil).instantiateInitialViewController()!
        //2.添加子控制器
        self.addChildViewController(childVC)
    }
}
